<template>
  <div id="app">
    <div class="video-priview">
      <div class="close" @click="closed"><span class="el-icon-close"></span></div>
      <div class="box">
        <video :src="src" type="video/mp4" autoplay></video>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    src: {
      type: String,
      default: ''
    }
  },
  methods: {
    closed () {
      this.$emit('close')
    }
  }
}
</script>

<style scoped>
#app {
  width: 100%;
  height: 100%;
}
.video-priview {
  width: 100%;
  height: 100%;
  position: fixed;
  left: 0;
  top: 0;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
  z-index: 9999;
}
.close {
  position: absolute;
  top: 30px;
  left: 50%;
  width: 50px;
  height: 50px;
  color: #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 5px rgba(0 0 0 / 40%);
  font-size: 20px;
  line-height: 50px;
  text-align: center;
}
.box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 600px;
}
video {
  width: 100%;
  height: 100%;
}
</style>
